﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RecipeSearch.aspx.cs" Inherits="RecipeSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <form runat="server">

        <table runat="server" style="width: 100%; margin-bottom: 30px">
            <tr class="jumbotron">
                <td style="width: 33%">
                    <h3 style="padding-left: 60px">Filtrering</h3>
                    <div class="jumbotron">

                        <asp:TextBox ID="txtSearchRecipe" CssClass="form-control" Style="width: 100%; float: left" runat="server" OnClick="this.value=''" placeholder="Søg efter opskrift"></asp:TextBox>

                        <br />
                        <br />
                        <asp:DropDownList ID="DropDownListMenu" AutoPostBack="true" runat="server" CssClass="form-control" OnSelectedIndexChanged="DropDownListMenu_SelectedIndexChanged">
                            <asp:ListItem Value="Vælge Menu" />
                            <asp:ListItem Value="Forret" />
                            <asp:ListItem Value="Hovedret" />
                            <asp:ListItem Value="Dessert" />
                        </asp:DropDownList>
                    </div>
                </td>
                <td style="width: 66%" class="jumbotron">
                    <div>
                        <div runat="server" style="float: left; width: 50%">
                            <h4 style="text-align: center">Filtrerings muligheder</h4>
                            <asp:ListBox ID="ExtingAllergies" runat="server" SelectionMode="Multiple" Width="100%" Rows="5" CssClass="form-control" DataSourceID="AllergiesDataSource" DataTextField="Name" DataValueField="Id" AppendDataBoundItems="false"></asp:ListBox>
                            <asp:Button ID="MoveRight" Text=">>" runat="server" Width="100%" CssClass="btn-primary btn btn-group-justified" Style="height: 35px" OnClick="MoveRight_Click" />
                        </div>
                        <div runat="server" style="float: right; width: 50%">
                            <h4 style="text-align: center">Valgte allergier</h4>
                            <asp:ListBox ID="ChoosenAllergies" runat="server" SelectionMode="Multiple" Width="100%" Rows="5" CssClass="form-control"></asp:ListBox>
                            <asp:Button ID="MoveLeft" Text="<<" runat="server" Width="100%" CssClass="btn-primary btn btn-group-justified" Style="height: 35px" OnClick="MoveLeft_Click" />
                        </div>
                        <asp:Button ID="searchBtn" runat="server" Text="Søg" CssClass="btn btn-success" OnClick="btnSearchRecipeByAllergy_Click" Style="margin-top: 10px; float: right" />
                        <asp:ObjectDataSource ID="AllergiesDataSource" runat="server" SelectMethod="SelectAllAllergies" DataObjectTypeName="Id" TypeName="WcfBackend.WcfFoodAndAllergiesClient"></asp:ObjectDataSource>

                    </div>

                </td>


            </tr>
        </table>
        <div>

            <asp:ListView ID="lstSearchRecipe" runat="server">

                <LayoutTemplate>
                    <table runat="server" style="width: 100%" class="table table-striped jumbotron">
                        <tr runat="server">
                            <td runat="server" style="font-size: large; width: 50%; text-align: center">Opskrift

                            </td>
                            <td runat="server" style="font-size: large; width: 25%; text-align: center">Serveringer

                            </td>
                            <td runat="server" style="font-size: large; width: 25%; text-align: center">Type

                            </td>

                        </tr>
                        <tr id="ItemPlaceholder" runat="server" >
                        </tr>
                    </table>

                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:LinkButton Style="display: block;" ID="lbSelect" runat="server" OnClick="on_Click" CommandArgument='<%# Eval("id") %>'>
                                <asp:Label
                                    ID="recipeName"
                                    runat="server"
                                    Text='<%# Eval("name")%>'> 
                                     
                                </asp:Label>
                            </asp:LinkButton>
                        </td>
                        <td style="text-align: center">

                            <asp:Label
                                ID="recipeServings"
                                runat="server"
                                Text='<%# Eval("Servings")%>'>
                               
                            </asp:Label>

                        </td>
                        <td style="text-align: center">

                            <asp:Label
                                ID="recipeType"
                                runat="server"
                                Text='<%# Eval("TypeOf")%>'>  
                            </asp:Label>

                        </td>

                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </div>
    </form>
    <%-- OnClick="btnSearchRecipeByMenu_Click"--%>
</asp:Content>

